#if !defined(AFX_TEMPLETPREVIEWWND_H__D052E5BA_9A3F_4C26_BC8E_A9D48C7804B5__INCLUDED_)
#define AFX_TEMPLETPREVIEWWND_H__D052E5BA_9A3F_4C26_BC8E_A9D48C7804B5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TempletPreviewWnd.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CTempletPreviewWnd window

struct ReportTempletHeader;
class ReportField;
struct MonUnitItem;

class CTempletPreviewWnd : public CWnd
{
// Construction
public:
	CTempletPreviewWnd();

// Attributes
public:
  int m_nTempletWidth;
  int m_nTempletHeight;
  int m_nHMax;
  int m_nVMax;
  int m_nHPos;
  int m_nVPos;
  std::vector<int> m_vecWidth;
  std::vector<int> m_vecHeight;

// Operations
public:
  void UpdateDisplay();
  int CalcTempletWidth(CDC& dc);
  int CalcTempletHeight(CDC& dc);
  int CalcTableWidth(CDC& dc);
  int CalcHeadWidth(CDC& dc);
  int CalcFootWidth(CDC& dc);
  int CalcTimeWidth(CDC& dc);
  static int CalcTextWidth(CDC& dc, const LOGFONT& lf, LPCTSTR lpszText);
  int CalcTableHeight(CDC& dc);
  int CalcHeadHeight(CDC& dc);
  int CalcFootHeight(CDC& dc);
  int CalcTimeHeight(CDC& dc);
  static int CalcFontHeight(CDC& dc, const LOGFONT& lf);
  static CString GetTempletItemString(int nCol, int nRow, ReportField * pReportField, MonUnitItem * pMonUnitItem, bool bPlaceHolder = false);
  void ParamReady();
  ReportTempletHeader * GetpReportTempletHeader() const;
  const std::vector<ReportField *>& GetReportFields() const;
  const std::vector<MonUnitItem *>& GetMonUnitItems() const;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTempletPreviewWnd)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CTempletPreviewWnd();

	// Generated message map functions
protected:
	//{{AFX_MSG(CTempletPreviewWnd)
	afx_msg void OnPaint();
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TEMPLETPREVIEWWND_H__D052E5BA_9A3F_4C26_BC8E_A9D48C7804B5__INCLUDED_)
